1. Field of the Invention
The present invention relates to an apparatus and a method for reproducing a MIDI-based music file.
2. Description of the Related Art
To reproduce a MIDI (musical instrument digital interface) file into a real sound, many methods can be used. Representative methods include a frequency modulation (FM) synthesis method and a wave table synthesis method. The FM synthesis method reproduces a sound by synthesizing basic waveforms. Since the FM synthesis method does not require a separate sound source, it has an advantage of using a small amount of memory but has a disadvantage of not reproducing a natural sound close to an original sound. On the contrary, the wave table synthesis method stores sound sources for each instrument and each note of each instrument in advance and synthesizes these sound sources to reproduce a sound. The wave table synthesis method has a disadvantage of using a large amount of memory in storing the sound sources, but has an advantage of reproducing a natural sound close to an original sound.
To hear a sound in real-time through a MIDI file reproducing system, a process of synthesizing a sound using a MIDI file and a sound source should be performed in real-time. A process of synthesizing a sound requires a considerable amount of processor resources. Parts that use the processor resources in the MIDI file reproducer include an envelope generator. The envelope generator is used to generate the envelope of a sound waveform determining the size of the volume or the pitch of a sound. Therefore, the envelope generator has a considerable influence on sound quality and uses a large portion of the processor resources.
Here, the envelope includes an envelope for the volume and an envelope for the pitch. Referring to FIGS. 1 and 2, the envelope is divided into four steps of Attack 12, Decay 13, Sustain 17, and Release 14 after Delay 11 starting from Note-On 15. Though the envelope is expressed in a linear form in FIG. 1, it can have a linear form or a concave form depending on the kind of the envelope and the characteristic of each step. Also, articulation data, which is information representing a unique characteristic of a sound source, contains time information for the four steps of Attack 12, Decay 13, Sustain 17, Release 14 and is used in synthesizing a sound. One note is reproduced by applying the above envelope and a plurality of notes are gathered to complete one musical piece.
When one note is reproduced by applying the envelope of FIG. 2, an envelope waveform should exponentially reduce with respect to a time axis to achieve a smooth waveform. Since the size of an envelope has been illustrated with a dB (decibel) scale with respect to a time axis in FIG. 1, the envelope waveform has a straight line shape. On the contrary, referring to FIG. 2, it is revealed that a note exponentially reduces during steps Decay and Release. However, since it is difficult for a reproducing apparatus (e.g., a mobile terminal) having limited resources to reproduce a note in this manner, development of a new technology is required to reproduce sufficient sound quality even when the limited resources are used.
FIG. 3 is a view of an apparatus for reproducing a MIDI file. The apparatus includes: a MIDI parser 21 for extracting a plurality of notes and note reproduction times from a MIDI file; a MIDI sequencer 22 for sequentially outputting the extracted note reproduction times; a wave table 24 for registering at least one sound source sample; and a frequency converter 23 for frequency-converting at least one registered sound sample into sound source samples that correspond to respective notes whenever the note reproduction time is outputted.
The MIDI file inputted to the MIDI parser 21 contains information regarding predetermined music stored in advance in a storage medium thereof. The MIDI file can include a plurality of notes and note reproduction times. A note is information representing a sound. For example, the note represents information (e.g., Do, Re, and Mi) regarding a musical scale. Since the note is not a real sound, it should be reproduced into actual sound sources. Also, the note reproduction time means a reproduction time of each of the notes contained in the MIDI file and is information regarding the same length of a sound. For example, when the reproduction time of a note “Re” is ⅛ second, a sound source that corresponds to the note “Re” is reproduced for ⅛ second when it is reproduced.
Sound sources for each instrument and each note of each instrument are registered in the wave table 24. A musical scale includes 1 to 128. There is a limitation in registering all of sound sources for the musical scale (i.e., notes contained therein) in the wave table 24. Therefore, sound source samples for only several representative notes are registered in the wave table 24.
When the reproduction time for the note is inputted, the frequency converter 23 judges whether a sound source for the relevant note is present in the wave table 24 and frequency-converts the note into a sound source that correspond to the relevant note. The frequency converter 23 may be an oscillator.
In the case where a sound source for the relevant note is not present in the wave table 24, the frequency converter 23 reads a predetermined sound source sample from the wave table 24 and frequency-converts the read sound source sample into a sound source sample that corresponds to the relevant note. In the case where a sound source for the relevant note is present in the wave table 24, the frequency converter 23 reads the relevant sound source sample from the wave table 24 and outputting the same without a separate frequency conversion. For example, in the case where a sound source sample registered in the wave table 24 is sampled by 20 kHz and a note of desired music is sampled by 40 kHz, the sound source sample is finally frequency-converted into 40 kHz and reproduced. That is, the sound source sample of 20 kHz can be frequency-converted and outputted into a sound source sample of 40 kHz by the frequency converter 23.
The above processes are repeatedly performed whenever the note reproduction time for each note is inputted. However, in the case where the frequency conversion is repeatedly performed whenever the note reproduction time for each note is inputted as described above, a considerable amount of operations is required, so that the relevant processor can be overloaded. Moreover, the relevant MIDI file should be reproduced and outputted in real-time. However, since the frequency conversion is performed for each note as described above, music may not be reproduced in real-time. In short, the MIDI reproducing apparatus can reproduce music substantially only in the case where it uses a considerable amount of processor resources.